//
//  FYHomeViewController.swift
//  aj
//
//  Created by leeqb on 11/22/15.
//  Copyright © 2015 powerlee. All rights reserved.
//

import UIKit

class FYHomeViewController: AJBaseTableViewController {
    var bgImageNames = ["row_bg_memory", "row_bg_relation", "row_bg_marry_normal"]
    var rowHeight: CGFloat!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let bgImage = UIImage(named: "row_bg_relation")
        let scale = SCREEN_WIDTH / bgImage!.size.width
        rowHeight = bgImage!.size.height * scale
        
        AJBaseController.addWhiteStatusBar(self)
        self.tableView.zeroInsets()
    }
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        return rowHeight
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 3
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("FamilyCell", forIndexPath: indexPath)
        cell.zeroInsets()
        
        let imageView = cell.viewWithTag(1) as! UIImageView
        imageView.image = UIImage(named: bgImageNames[indexPath.row])
        
        return cell
    }
    
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        print(indexPath)
    }
    
}
